package com.panfeng.xcloud.boss.provider.member.service;

import com.panfeng.xcloud.boss.provider.member.dto.request.LoginReqDTO;
import com.panfeng.xcloud.boss.provider.member.dto.response.LoginTokenResponseDTO;
import com.panfeng.xcloud.boss.provider.member.enums.LoginModeEnum;
import com.panfeng.xcloud.common.security.vo.SysSecurityUser;
import com.panfeng.xcloud.dao.member.entity.UserBase;

import javax.servlet.http.HttpServletRequest;

/**
 *
 * 用户token业务service
 *
 * @author xiaobo
 * @version 1.0
 * @since 2018-12-28
 */
public interface IUserTokenService {

	/**
	 * 刷新token
	 *
	 * @param clientId
	 * @param clientSecret
	 * @param refreshToken
	 * @param request
	 * @return
	 */
	String refreshToken(String clientId,String clientSecret, String refreshToken, HttpServletRequest request) ;

	/**
	 * 登录获取token通过验证码进行登录
	 *
	 * @param loginModeEnum
	 * @param loginReqDTO
	 * @param request
	 * @return
	 */
	LoginTokenResponseDTO loginToken(LoginModeEnum loginModeEnum, LoginReqDTO loginReqDTO, HttpServletRequest request);


	/**
	 * 设置token失效
	 *
	 * @param accessToken
	 */
	void expireToken(String accessToken);

	/**
	 * 处理认证后数据
	 *
	 * @param loginTokenResponseDto
	 * @param sysSecurityUser
	 * @param request
	 * @param userBase
	 */
	void authAfterHandleData(final LoginTokenResponseDTO loginTokenResponseDto, final SysSecurityUser sysSecurityUser, final HttpServletRequest request, final UserBase userBase);

}
